package com.kingtop.base.model;

import javax.validation.constraints.NotBlank;

import org.kingtop.model.IUserPO;
import org.kingtop.mybatis.persistence.Column;
import org.kingtop.mybatis.persistence.Id;
import org.kingtop.mybatis.persistence.Table;

/**
 * 用户表
 * @author Administrator
 * @version 1.0
 * @created 2017-12-17 22:10:58
 */
@Table(name="T_BASE_USER")
public class BaseUser implements IUserPO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3887113231101960517L;

	@Id
	@Column(name="ID")
	private Long id;
	
	/**
	*	用户名
	*/
	@NotBlank
	@Column(name="USER_NAME")
	private String userName;
	
	/**
	*	名称
	*/
	@Column(name="NICKNAME")
	private String nickname;
	
	/**
	*	密码
	*/
	@Column(name="PASSWORD")
	private String password;
	
	/**
	*	加密密码的盐
	*/
	@Column(name="SALT")
	private String salt;
	
	/**
	*	部门id，根据用户所在的部门，确定其所在的地区
	*/
	@Column(name="DEPARTMENT_ID")
	private Long departmentId;
	
	/**
	*	是否可用，1：可用；0：不可用
	*/
	@Column(name="STATUS")
	private Integer status;
	

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "BaseUser [id=" + id + ", userName=" + userName + ", nickname=" + nickname + ", password=" + password + ", salt=" + salt + ", departmentId=" + departmentId + ", status=" + status + "]";
	}

	public BaseUser(){
		
	}
	
	public void setId(Long id)
	{
		this.id = id;
	}
	
	public Long getId()
	{
		return this.id;
	}
	
	public void setUserName(String userName)
	{
		this.userName = userName;
	}
	
	public String getUserName()
	{
		return this.userName;
	}

	public void setNickname(String nickname)
	{
		this.nickname = nickname;
	}
	
	public String getNickname()
	{
		return this.nickname;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}
	
	public String getPassword()
	{
		return this.password;
	}

	public void setSalt(String salt)
	{
		this.salt = salt;
	}
	
	public String getSalt()
	{
		return this.salt;
	}

	public void setDepartmentId(Long departmentId)
	{
		this.departmentId = departmentId;
	}
	
	public Long getDepartmentId()
	{
		return this.departmentId;
	}

	@Override
	public int getLocked() {
		return 0;
	}

	/**
	 * @return the status
	 */
	public Integer getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}

}